package guess;

import java.util.Scanner;

/**
 * 玩家类
 */
public class Player extends Role{
    private Scanner sc = new Scanner(System.in);
    public Player(){}
    public Player(String name) {
        super(name);
    }

    /**
     * 玩家出拳的方法
     */
    public int guess(){
        while (true) {
            System.out.println("请选择：0-剪刀 1-石头 2-布");
            int result = sc.nextInt();
            if(result < 0 || result > 2){
                System.out.println("输入有误，请重新输入");
                continue;
            }
            return result;
        }
    }
}
